home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / Fresco / build / Unix / config / cf / Library.tmpl < prev    next >
Text File  |  1995-07-12  |  8KB  |  265 lines

  1. /*
  2.  * Library imakefile info  - this contains any special redefinitions, etc.
  3.  * that Imakefiles in the various library subtrees will need.
  4.  *
  5.  * Before including this, you must set the following boolean variables:
  6.  * DoNormalLib, DoSharedLib, DoDebugLib, DoProfileLib
  7.  *
  8.  * To get automatic generation of standard rules, also set the variables:
  9.  * LibName, SoRev, HasSharedData, and optionally HugeLibrary and IncSubdir
  10.  */
  11.  
  12. XCOMM $XConsortium: Library.tmpl,v 1.32 94/05/14 15:10:41 rws Exp $
  13.  
  14. #ifndef LibraryCplusplusOptions
  15. #if DoSharedLib && defined(SharedLibraryCplusplusOptions)
  16. #define LibraryCplusplusOptions SharedLibraryCplusplusOptions
  17. #else
  18. #define LibraryCplusplusOptions DefaultCplusplusOptions
  19. #endif
  20. #endif
  21. #ifndef LibraryDefines
  22. #define LibraryDefines StandardDefines
  23. #endif
  24. #ifndef LibraryCDebugFlags
  25. #define LibraryCDebugFlags DefaultCDebugFlags
  26. #endif
  27. #ifndef LibraryCplusplusDebugFlags
  28. #define LibraryCplusplusDebugFlags DefaultCplusplusDebugFlags
  29. #endif
  30. #ifndef SeparateSharedCompile
  31. #define SeparateSharedCompile YES
  32. #endif
  33.  
  34. #ifndef CplusplusSource
  35. #ifndef LibraryCcCmd
  36. #if DoSharedLib && defined(SharedLibraryCcCmd)
  37. #define LibraryCcCmd SharedLibraryCcCmd
  38. #else
  39. #define LibraryCcCmd CcCmd
  40. #endif
  41. #endif
  42. #ifndef LibraryCCOptions
  43. #if DoSharedLib && defined(SharedLibraryCCOptions)
  44. #define LibraryCCOptions SharedLibraryCCOptions
  45. #else
  46. #define LibraryCCOptions DefaultCCOptions
  47. #endif
  48. #endif
  49.  
  50.          CC = LibraryCcCmd
  51.   CCOPTIONS = LibraryCCOptions
  52. STD_DEFINES = LibraryDefines
  53. CDEBUGFLAGS = LibraryCDebugFlags
  54. #else
  55. #ifndef LibraryCplusplusCmd
  56. #if DoSharedLib && defined(SharedLibraryCplusplusCmd)
  57. #define LibraryCplusplusCmd SharedLibraryCplusplusCmd
  58. #else
  59. #define LibraryCplusplusCmd CplusplusCmd
  60. #endif
  61. #endif
  62. #ifndef LibraryCplusplusOptions
  63. #if DoSharedLib && defined(SharedLibraryCplusplusOptions)
  64. #define LibraryCplusplusOptions SharedLibraryCplusplusOptions
  65. #else
  66. #define LibraryCplusplusOptions DefaultCplusplusOptions
  67. #endif
  68. #endif
  69.  
  70.           CXX = LibraryCplusplusCmd
  71.    CXXOPTIONS = LibraryCplusplusOptions
  72.   STD_DEFINES = LibraryDefines
  73. CXXDEBUGFLAGS = LibraryCplusplusDebugFlags
  74. #endif
  75.  
  76. #if DoDebugLib
  77. #define _DebuggedLibMkdir() LibMkdir(debugger)
  78. #ifndef CplusplusSource
  79. #define _DebuggedObjCompile(options) DebuggedLibObjCompile(options)
  80. #else
  81. #define _DebuggedObjCompile(options) DebuggedLibObjCplusplusCompile(options)
  82. #endif
  83. #define _DebuggedCleanDir() LibCleanDir(debugger)
  84. #else
  85. #define _DebuggedLibMkdir() $(_NULLCMD_)
  86. #define _DebuggedObjCompile(options) $(_NULLCMD_)
  87. #define _DebuggedCleanDir() $(_NULLCMD_)
  88. #endif
  89.  
  90. #if DoProfileLib
  91. #define _ProfiledLibMkdir() LibMkdir(profiled)
  92. #ifndef CplusplusSource
  93. #define _ProfiledObjCompile(options) ProfiledLibObjCompile(options)
  94. #else
  95. #define _ProfiledObjCompile(options) ProfiledLibObjCplusplusCompile(options)
  96. #endif
  97. #define _ProfiledCleanDir() LibCleanDir(profiled)
  98. #else
  99. #define _ProfiledLibMkdir() $(_NULLCMD_)
  100. #define _ProfiledObjCompile(options) $(_NULLCMD_)
  101. #define _ProfiledCleanDir() $(_NULLCMD_)
  102. #endif
  103.  
  104. #if !DoNormalLib
  105. #define _NormalLibMkdir() $(_NULLCMD_)
  106. #define _NormalObjCompile(options) $(_NULLCMD_)
  107. #define _NormalCleanDir() $(_NULLCMD_)
  108. #else
  109. #if DoSharedLib && SeparateSharedCompile
  110. #define _NormalLibMkdir() LibMkdir(unshared)
  111. #ifndef CplusplusSource
  112. #define _NormalObjCompile(options) UnsharedLibObjCompile(options)
  113. #else
  114. #define _NormalObjCompile(options) UnsharedLibObjCplusplusCompile(options)
  115. #endif
  116. #define _NormalCleanDir() LibCleanDir(unshared)
  117. #else
  118. #define _NormalLibMkdir() $(_NULLCMD_)
  119. #ifndef CplusplusSource
  120. #define _NormalObjCompile(options) NormalLibObjCompile(options)
  121. #else
  122. #define _NormalObjCompile(options) NormalLibObjCplusplusCompile(options)
  123. #endif
  124. #define _NormalCleanDir() $(_NULLCMD_)
  125. #endif
  126. #endif
  127.  
  128. #if !DoSharedLib || (DoNormalLib && !SeparateSharedCompile)
  129. #define _SharedObjCompile(options) $(_NULLCMD_)
  130. #else
  131. #if SeparateSharedCompile
  132. #ifndef CplusplusSource
  133. #define _SharedObjCompile(options) NormalSharedLibObjCompile(options)
  134. #else
  135. #define _SharedObjCompile(options) NormalSharedLibObjCplusplusCompile(options)
  136. #endif
  137. #else
  138. #ifndef CplusplusSource
  139. #define _SharedObjCompile(options) NormalLibObjCompile(options)
  140. #else
  141. #define _SharedObjCompile(options) NormalLibObjCplusplusCompile(options)
  142. #endif
  143. #endif
  144. #endif
  145.  
  146. #ifndef CplusplusSource
  147. #define SRCsuf c
  148. #else
  149. #define SRCsuf CCsuf
  150. #ifdef SunArchitecture
  151. .SUFFIXES: .CCsuf
  152. #endif
  153. #endif
  154.  
  155. #ifndef LibraryObjectRule
  156. #define LibraryObjectRule()                        @@\
  157. all::                                    @@\
  158.     _DebuggedLibMkdir()                        @@\
  159.     _ProfiledLibMkdir()                        @@\
  160.     _NormalLibMkdir()                        @@\
  161.                                     @@\
  162. includes::                                @@\
  163.     _DebuggedLibMkdir()                        @@\
  164.     _ProfiledLibMkdir()                        @@\
  165.     _NormalLibMkdir()                        @@\
  166.                                     @@\
  167. .SRCsuf.Osuf:                                @@\
  168.     _DebuggedObjCompile($(_NOOP_))                    @@\
  169.     _ProfiledObjCompile($(_NOOP_))                    @@\
  170.     _NormalObjCompile($(_NOOP_))                    @@\
  171.     _SharedObjCompile($(_NOOP_))                    @@\
  172.                                     @@\
  173. clean::                                    @@\
  174.     _DebuggedCleanDir()                        @@\
  175.     _ProfiledCleanDir()                        @@\
  176.     _NormalCleanDir()                        @@\
  177.  
  178. #endif /* LibraryObjectRule */
  179.  
  180. #ifndef SpecialLibObjectRule
  181. #define SpecialLibObjectRule(objs,depends,options)            @@\
  182. objs: depends                                @@\
  183.     _DebuggedObjCompile(options)                    @@\
  184.     _ProfiledObjCompile(options)                    @@\
  185.     _NormalObjCompile(options)                    @@\
  186.     _SharedObjCompile(options)                    @@\
  187.  
  188. #endif /* SpecialLibObjectRule */
  189.  
  190. #ifndef SpecialCLibObjectRule
  191. #define SpecialCLibObjectRule(basename,depends,options)            @@\
  192. SpecialLibObjectRule(basename.Osuf,basename.SRCsuf depends,options)    @@\
  193.                                     @@\
  194. basename.i: basename.SRCsuf depends                    @@\
  195.     CPPOnlyCompile(basename.SRCsuf,options)                @@\
  196.                                     @@\
  197. CenterLoadTarget(debug_src,basename.SRCsuf,NullParameter,$(ALLDEFINES) options)
  198. #endif /* SpecialCLibObjectRule */
  199.  
  200. #ifndef SpecialCplusplusLibObjectRule
  201. #define SpecialCplusplusLibObjectRule(basename,depends,options)        @@\
  202. SpecialLibObjectRule(basename.Osuf,basename.SRCsuf depends,options)    @@\
  203.                                     @@\
  204. CenterLoadTarget(debug_src,basename.SRCsuf,NullParameter,$(ALLDEFINES) options)
  205. #endif /* SpecialCplusplusLibObjectRule */
  206.  
  207. #ifdef LibName
  208.  
  209. LIBNAME = LibName
  210.  
  211. LibraryObjectRule()
  212.  
  213. #undef _LinkBuildLibrary
  214. #define _LinkBuildLibrary(lib) LinkBuildLibrary(lib)
  215.  
  216. #if DoSharedLib
  217. SharedLibraryTarget($(LIBNAME),$(SoRev),$(OBJS),.,.)
  218. InstallSharedLibrary($(LIBNAME),$(SoRev),$(SHLIBDIR))
  219. #if HasSharedData
  220. SharedLibraryDataTarget($(LIBNAME),$(SoRev),$(UNSHAREDOBJS))
  221. InstallSharedLibraryData($(LIBNAME),$(SoRev),$(SHLIBDIR))
  222. #endif
  223. #endif
  224. #if DoNormalLib
  225. #if HugeLibrary
  226. #if DoSharedLib && SeparateSharedCompile
  227. UnsharedLibraryTarget3($(LIBNAME),$(OBJS1),$(OBJS2),$(OBJS3),unshared,..)
  228. #else
  229. NormalLibraryTarget3($(LIBNAME),$(OBJS1),$(OBJS2),$(OBJS3))
  230. #endif
  231. #else
  232. #if DoSharedLib && SeparateSharedCompile
  233. UnsharedLibraryTarget($(LIBNAME),$(OBJS),unshared,..)
  234. #else
  235. NormalLibraryTarget($(LIBNAME),$(OBJS))
  236. #endif
  237. #endif
  238. InstallLibrary($(LIBNAME),$(USRLIBDIR))
  239. #endif
  240. #if DoProfileLib
  241. ProfiledLibraryTarget($(LIBNAME),$(OBJS))
  242. InstallLibrary($(LIBNAME)_p,$(USRLIBDIR))
  243. #endif
  244. #if DoDebugLib
  245. DebuggedLibraryTarget($(LIBNAME),$(OBJS))
  246. InstallLibrary($(LIBNAME)_d,$(USRLIBDIR))
  247. #endif
  248.  
  249. LintLibraryTarget($(LIBNAME),$(SRCS))
  250. InstallLintLibrary($(LIBNAME),$(LINTLIBDIR))
  251. #ifdef IncSubdir
  252. BuildIncludes($(HEADERS),IncSubdir,..)
  253. InstallMultipleFlags($(HEADERS),$(INCDIR)/IncSubdir,$(INSTINCFLAGS))
  254. #else
  255. #ifndef CplusplusSource
  256. #if !defined(LibHeaders) || LibHeaders
  257. BuildIncludesTop($(HEADERS))
  258. InstallMultipleFlags($(HEADERS),$(INCDIR),$(INSTINCFLAGS))
  259. #endif
  260. #endif
  261. #endif
  262.  
  263. NormalLintTarget($(SRCS))
  264. #endif
  265.